import Vue from 'vue'
import 'normalize.css/normalize.css'

import ElementUI, { Table } from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en'
import '@/styles/index.scss'
import '@/icons/font/iconfont.css'

import App from './App.vue'
import router from './router'
import store from './store'
import moment from 'moment'
Vue.prototype.$moment = moment

// 解决 ElTable 自动宽度高度导致的「ResizeObserver loop limit exceeded」问题
const fixElTableErr = (table) => {
    const oldResizeListener = table.methods.resizeListener;
    table.methods.resizeListener = function () {
        window.requestAnimationFrame(oldResizeListener.bind(this));
    };
};
fixElTableErr(Table);

Vue.use(ElementUI, { locale })

Vue.config.productionTip = false

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
